package com.cl.short_video_java.web.role;

import com.cl.short_video_java.annotation.IsRole;
import com.cl.short_video_java.annotation.Login;
import com.cl.short_video_java.common.Const;
import com.cl.short_video_java.common.Result;
import com.cl.short_video_java.service.SysRoleMenuService;
import com.cl.short_video_java.vo.role.RoleMenu;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 付
 * @Date 2024-11-17 10:27
 * @Version 1.0
 * @description 角色权限设置
 * @since 1.0
 */

@RestController
@RequestMapping("/admin/role")
public class RoleMenuController {
	private SysRoleMenuService sysRoleMenuService;

	public RoleMenuController(SysRoleMenuService sysRoleMenuService) {
		this.sysRoleMenuService = sysRoleMenuService;
	}


	@PostMapping("/menu/save")
	@Login(issuer = Const.GRADE_ADMIN)
	@IsRole(menuId = 37)
	public Result save(@RequestBody RoleMenu roleMenu) {
		sysRoleMenuService.save(roleMenu);
		return Result.success();
	}

}
